package(default_visibility = ["//visibility:public"])

load(
    "@io_bazel_rules_go//go:def.bzl",
    "go_library",
    "go_test",
)

go_library(
    name = "go_default_library",
    srcs = [
        "controller.go",
        "doc.go",
        "jenkins.go",
        "metrics.go",
    ],
    importpath = "k8s.io/test-infra/prow/jenkins",
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/client/clientset/versioned/typed/prowjobs/v1:go_default_library",
        "//prow/config:go_default_library",
        "//prow/github:go_default_library",
        "//prow/github/report:go_default_library",
        "//prow/kube:go_default_library",
        "//prow/pjutil:go_default_library",
        "//prow/pod-utils/downwardapi:go_default_library",
        "@com_github_bwmarrin_snowflake//:go_default_library",
        "@com_github_prometheus_client_golang//prometheus:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/types:go_default_library",
        "@io_k8s_apimachinery//pkg/util/clock:go_default_library",
        "@io_k8s_apimachinery//pkg/util/wait:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
)

go_test(
    name = "go_default_test",
    srcs = [
        "controller_test.go",
        "jenkins_test.go",
    ],
    embed = [":go_default_library"],
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/client/clientset/versioned/fake:go_default_library",
        "//prow/config:go_default_library",
        "//prow/github:go_default_library",
        "//prow/pjutil:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/runtime:go_default_library",
        "@io_k8s_apimachinery//pkg/util/clock:go_default_library",
    ],
)
